﻿using System;

using YourLastOptionsDialog.Core.Attributes;

namespace YourLastOptionsDialog.ViewModels.Options
{
    /// <summary>
    /// An option that represents a <see cref="DateTime"/> value.
    /// </summary>
    public class DateTimeOption : Option
    {
        private DateTimeMode _mode;

        /// <summary>
        /// Gets or sets the value wrapped by this option.
        /// </summary>
        public DateTime Value
        {
            get
            {
                return (DateTime)GetAccessor();
            }

            set
            {
                SetAccessor(value);
                RaisePropertyChanged("Value");
            }
        }

        /// <summary>
        /// Gets or sets the mode used for this <see cref="DateTime"/> instance.
        /// </summary>
        public DateTimeMode Mode
        {
            get
            {
                return _mode;
            }

            set
            {
                if (_mode != value)
                {
                    _mode = value;
                    RaisePropertyChanged("Mode");
                }
            }
        }
    }
}